﻿
using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using Kevin.Framework.Data.OrmMapping;
using Kevin.Framework.Validation;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
/*------------------------------------------------------------------------
   苏州捷安信息科技有限公司 版权所有			
   文件名: TU_Menus.cs
   作 者 : 席吉波
   日 期 : 2012-10-16
   备 注 : 当您对本文件更改时请写明修改人、修改日期以及事由
  ------------------------------------------------------------------------
*/
namespace JOIN.Rights.Model
{
    //TU_Menus
    [Serializable]
    [TableMapping("TU_Menus")]
    public class MenusInfo : EntityBase
    {
        #region Constructor

        public MenusInfo()
            : this("")
        { }
        public MenusInfo(string connectionKey)
            : base(connectionKey)
        { }

        #endregion


        private string _id;
        /// <summary>
        /// 项目编码
        /// </summary>		
        [FieldMapping("ID",PrimaryKey=true)]
        public string ID
        {
            get
            {
                return _id;
            }
            set
            {
                if (_id != value)
                {
                    base.OnPropertyChanged("ID", _id, value);
                    _id = value;
                }
            }
        }

        private string _projectid;
        /// <summary>
        /// 项目编码
        /// </summary>		
        [FieldMapping("ProjectID")]
        [NotNullValidator(MessageTemplate = "项目编码不能为空")]
        public string ProjectID
        {
            get
            {
                return _projectid;
            }
            set
            {
                if (_projectid != value)
                {
                    base.OnPropertyChanged("ProjectID", _projectid, value);
                    _projectid = value;
                }
            }
        }

        private string _menuid;
        /// <summary>
        /// 菜单编号
        /// </summary>		
        [FieldMapping("MenuID")]
        [NotNullValidator(MessageTemplate = "菜单编号不能为空")]
        public string MenuID
        {
            get
            {
                return _menuid;
            }
            set
            {
                if (_menuid != value)
                {
                    base.OnPropertyChanged("MenuID", _menuid, value);
                    _menuid = value;
                }
            }
        }

        private string _menuname;
        /// <summary>
        /// 菜单名称
        /// </summary>		
        [FieldMapping("MenuName")]
        [NotNullValidator(MessageTemplate = "菜单名称不能为空")]
        public string MenuName
        {
            get
            {
                return _menuname;
            }
            set
            {
                if (_menuname != value)
                {
                    base.OnPropertyChanged("MenuName", _menuname, value);
                    _menuname = value;
                }
            }
        }

        private string _menudesc;
        /// <summary>
        /// 菜单说明
        /// </summary>		
        [FieldMapping("MenuDesc")]
        public string MenuDesc
        {
            get
            {
                return _menudesc;
            }
            set
            {
                if (_menudesc != value)
                {
                    base.OnPropertyChanged("MenuDesc", _menudesc, value);
                    _menudesc = value;
                }
            }
        }

        private string _menulink;
        /// <summary>
        /// 菜单连接地址(Web中为Url，winform中为Form地址)
        /// </summary>		
        [FieldMapping("MenuLink")]
        public string MenuLink
        {
            get
            {
                return _menulink;
            }
            set
            {
                if (_menulink != value)
                {
                    base.OnPropertyChanged("MenuLink", _menulink, value);
                    _menulink = value;
                }
            }
        }

        private int _menulevel;
        /// <summary>
        /// 菜单级数
        /// </summary>		
        [FieldMapping("MenuLevel")]
        public int MenuLevel
        {
            get
            {
                return _menulevel;
            }
            set
            {
                if (_menulevel != value)
                {
                    base.OnPropertyChanged("MenuLevel", _menulevel, value);
                    _menulevel = value;
                }
            }
        }

        private string _menuparent;
        /// <summary>
        /// 父菜单编号
        /// </summary>		
        [FieldMapping("MenuParent")]
        public string MenuParent
        {
            get
            {
                return _menuparent;
            }
            set
            {
                if (_menuparent != value)
                {
                    base.OnPropertyChanged("MenuParent", _menuparent, value);
                    _menuparent = value;
                }
            }
        }

        private string _menuicourl;
        /// <summary>
        /// 菜单图标地址
        /// </summary>		
        [FieldMapping("MenuIcoUrl")]
        public string MenuIcoUrl
        {
            get
            {
                return _menuicourl;
            }
            set
            {
                if (_menuicourl != value)
                {
                    base.OnPropertyChanged("MenuIcoUrl", _menuicourl, value);
                    _menuicourl = value;
                }
            }
        }

        private string _menucssname;
        /// <summary>
        /// 菜单项样式名称
        /// </summary>		
        [FieldMapping("MenuCssName")]
        public string MenuCssName
        {
            get
            {
                return _menucssname;
            }
            set
            {
                if (_menucssname != value)
                {
                    base.OnPropertyChanged("MenuCssName", _menucssname, value);
                    _menucssname = value;
                }
            }
        }

        private string _functionid;
        /// <summary>
        /// 功能ID
        /// </summary>		
        [FieldMapping("FunctionID")]
        public string FunctionID
        {
            get
            {
                return _functionid;
            }
            set
            {
                if (_functionid != value)
                {
                    base.OnPropertyChanged("FunctionID", _functionid, value);
                    _functionid = value;
                }
            }
        }

        private int _orderindex;
        /// <summary>
        /// 排序序号
        /// </summary>		
        [FieldMapping("OrderIndex")]
        public int OrderIndex
        {
            get
            {
                return _orderindex;
            }
            set
            {
                if (_orderindex != value)
                {
                    base.OnPropertyChanged("OrderIndex", _orderindex, value);
                    _orderindex = value;
                }
            }
        }

        private bool _popup;
        /// <summary>
        /// 是否直接弹出窗体
        /// </summary>
        [FieldMapping("Popup")]
        public bool Popup
        {
            get
            {
                return _popup;
            }
            set
            {
                if (_popup != value)
                {
                    base.OnPropertyChanged("Popup", _popup, value);
                    _popup = value;
                }
            }
        }

        public List<MenusInfo> SubMenu
        {
            get;
            set;
        }

       
    }
}